<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>帖子详情 - AACRBBS</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}">
</head>
<body>
    <div class="container">
        <h1>帖子详情</h1>
        <div class="post">
            {% set content_lines = post[2].split('\n') %}
            <h3>{{ post[1] }}: {{ content_lines[0] }}</h3>
            <p>{{ post[2] | replace('\n', '<br>') | safe }}</p>
            <p class="update">最后更新于 {{ post[4] }}</p>
            <div class="replies">
                <h4>回复</h4>
                {% for reply in replies %}
                <div class="reply">
                    <p><strong>{{ reply[0] }}</strong>: {{ reply[1] | replace('\n', '<br>') | safe }}</p>
                    <p>回复于 {{ reply[2] }}</p>
                </div>
                {% endfor %}
            </div>
        </div>
        <form method="POST" action="/reply/{{ post[0] }}">
            <label for="reply_content">回复内容</label>
            <textarea name="reply_content" id="reply_content" required></textarea><br>
            <button type="submit">回复</button>
        </form>
    </div>
</body>
</html>